﻿using PaperMaster.Chess.ChessModel;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace PaperMaster.Chess
{
    public class ChessBlockController
    {
        public ChessBlockModel model;
        /// <summary>
        /// 被选中时调用
        /// </summary>
        public virtual void OnSelect()
        {
            model.viewController.OnSelect();
        }
        /// <summary>
        /// 取消选中时调用
        /// </summary>
        public virtual void OnDeSelect()
        {
            model.viewController.OnDeSelect();
        }
    }
    public class ChessBlock : MonoBehaviour
    {


        // Start is called before the first frame update
        void Start()
        {

        }

        // Update is called once per frame
        void Update()
        {

        }

        public ChessBlockController controller = null;

        protected virtual void Init()
        {
        }
        /// <summary>
        /// 被选中时调用
        /// </summary>
        public virtual void OnSelect()
        {
            GetComponent<Renderer>().material = Resources.Load<Material>("Materials/Red");
        }
        /// <summary>
        /// 取消选中时调用
        /// </summary>
        public virtual void OnDeSelect()
        {
            GetComponent<Renderer>().material = Resources.Load<Material>("Materials/White");
        }

    }
}
